package com.core.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.dao.DataAccessException;

/**
 * Generic DAO for every entity registered in system
 * @author yanuar
 *
 * @param <E>
 * @param <PK>
 */
public interface GenericDao<E, PK extends Serializable> {
	

	PK save(E entity) throws DataAccessException;

	void update(E transientObject) throws DataAccessException;

	void saveOrUpdate(E transientObject) throws DataAccessException;

	void delete(E persistentObject) throws DataAccessException;

	E find(PK id) throws DataAccessException;

	List<E> findAll() throws DataAccessException;

	List<E> findAllByProperty(String propertyName, Object value)
			throws DataAccessException;

}
